<?php
if(!@include_once('database.php')){include 'database.php';}
include 'accent.php';
include 'siteclass.php';

$tbcatchoix = selectTb("select cat from categorie order by cote");
$selection = new Selection("catlien",array());
foreach ($tbcatchoix as $tb){
	$selection->__add(str_replace($dbaccent, $codeaccent, $tb[0]),false);
}

$tbs = selectTb("select cote, nom, lien, categorie from site order by cote");
$tablelien = new Tableau(1,"tblien",array("txt","txt","txt",$selection));
$tablelien->__setadd(True);
$tablelien->__setdel(True);
$tablelien->__setupdate(True);
$tablelien->__add(new Ligne(array("Cote","Nom","Hyperlien","Cat&#233;gorie")));
foreach ($tbs as $tb)
{
	$ligne = new Ligne(array());
	foreach ($tb as $elem)
	{
		$ligne->__add(str_replace($dbaccent, $codeaccent, $elem));
	}
	
	$tablelien->__add($ligne);
}
echo $tablelien->__tostring();
?>